#include <stdio.h>
typedef int ElemType;

typedef struct stack
{
    ElemType data;
    struct stack *next;
}Stack;

Stack* InitStack()
{
    Stack* s = (Stack*)malloc(sizeof(Stack));
    s->data = 0;
    s->next = NULL;
    return s;
}

int isEmpty(Stack* s)
{
    if(s->next == NULL)
    {
        printf("Stack is empty\n");
        return 1;
    }
    else
    {
        return 0;
    }
}

int push(Stack* s, ElemType e)
{
    Stack* p = (Stack*)malloc(sizeof(Stack));
    p->data = e;
    p->next = s->next;
    s->next = p;
    return 1;
}

int pop(Stack* s, ElemType* e)
{
    if(isEmpty(s))
    {
        return 0;
    }
    *e = s->next->data;
    Stack* p = s->next;
    s->next = p->next;
    free(p);
    return 1;
}

int main()
{

}